WEB_ADDR='127.0.0.1'
WEB_PORT=80

WEB_API=f"http://{WEB_ADDR}:{WEB_PORT}/api"

import requests as r
import json

RESULT_NOTIFY=f"{WEB_API}/notify-result"

def result_notify(record_id:int,data):
    if not isinstance(data,str):
        data=json.dumps(data)
    dt={
        'body':data,
        'record_id':record_id
    }
    response=r.post(RESULT_NOTIFY,dt)
    if response.status_code!=200:
        return False
    return True
